n=20
s=1
a=0
while True :
    a=s%3
    if a==0 and int(s)<21:
        print(f"{s}")
        s=s+1

    else:
        s = s + 1




for i in range(1,21):
    if i%3==0 :
        print(f"{i}")

